//登录请求
// class UserLoginRequestEntity {
//   String phone;
//   String password;
//
//   UserLoginRequestEntity({
//     @required this.phone,
//     @required this.password,
//   });
//
//   factory UserLoginRequestEntity.fromMap(Map<String, dynamic> map) {
//     return UserLoginRequestEntity(
//       phone: map["phone"],
//       password: map["password"],
//     );
//   }
//
//   Map<String, dynamic> toJson() => {
//         "phone": phone,
//         "password": password,
//       };
// }

import 'package:flutter/material.dart';

class UserLoginResponseEntity {
  int tag;
  String message;
  UserResult result;

  UserLoginResponseEntity({
    this.tag,
    this.message,
    this.result,
  });

  factory UserLoginResponseEntity.fromJson(Map<String, dynamic> map) {
    return UserLoginResponseEntity(
      tag: map['Tag'],
      message: map['Message'],
      result: map['Result'] == null ? null : UserResult.fromMap(map['Result']),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'Tag': tag,
      'Message': message,
      'Result': result,
    };
  }
}

class UserResult {
  String sessionToken;
  String phone;
  String avatarUrl;

  UserResult({
    @required this.sessionToken,
    this.phone,
    this.avatarUrl,
  });

  factory UserResult.fromMap(Map<String, dynamic> map) {
    return UserResult(
      sessionToken: map['SessionToken'],
      phone: map['Phone'],
      avatarUrl: map['AvatarUrl'],
    );
  }

  Map<String, dynamic> toJson() => {
        'SessionToken': sessionToken,
        'Phone': phone,
        'AvatarUrl': avatarUrl,
      };
}
